import java.util.Scanner;

public class ExceptionText {
    public static void main(String[] args) {
        System.out.println("输入一个数");
        Scanner scanner= new Scanner(System.in);
        int a=scanner.nextInt();
        try {
            int result=4/a;
            System.out.println("结果是"+result);
        }catch (Exception e){
            System.out.println("出现异常"+e.getMessage());
        }finally{
            System.out.println("都要执行的代码");
        }

    }
}
